package com.mycompany.app.testsuite.ibatis;

import org.apache.commons.lang.builder.ToStringBuilder;

import com.mycompany.app.dao.ibatis.PersonDAOIBatis;
import com.mycompany.app.model.Person;
import com.mycompany.app.testsuite.BaseTestUtils;
import com.mycompany.app.util.SpringUtils;

public class PersonDAOIBatisTest extends BaseTestUtils{
    public static void main(String[] args) {

        PersonDAOIBatis dao = (PersonDAOIBatis) SpringUtils
                .getApplicationContext().getBean("personDaoIBatis");

        System.out.println(ToStringBuilder.reflectionToString(dao.get(-3L)));
        System.out.println(ToStringBuilder.reflectionToString(dao.getAll()));
        Person p=dao.get(-3L);
        p.setId(null);
        dao.save(p);
        System.out.println(ToStringBuilder.reflectionToString(dao.get(-3L)));
        System.out.println(ToStringBuilder.reflectionToString(dao.getAll()));
        
    }

}
